import React, { Component } from "react";

class Child extends Component {
  render() {
    // console.log(this);
    // {this.props.children}相当于vue的<slot></slot>标签
    // 也可以插文本，标签和组件
    return <div>child组件 - {this.props.children}</div>;
  }
}

class App extends Component {
  render() {
    return (
      <>
        <h2>插槽</h2>
        {/* 默认情况下在标签中间写的内容是不会显示的 */}
        <Child>
          <span>123</span>
        </Child>
      </>
    );
  }
}

export default App;
